/**
 * Sencha GXT 3.1.1 - Sencha for GWT
 * Copyright(c) 2007-2014, Sencha, Inc.
 * licensing@sencha.com
 *
 * http://www.sencha.com/products/gxt/license/
 */
package com.sencha.gxt.data.loader;

import com.google.gwt.core.AsyncCallback;
import com.google.gwt.core.Callback;
import com.sencha.gxt.data.shared.loader.DataProxy;

public abstract class JDBCProxy<C, D> implements DataProxy<C, D> {

	public abstract void load(C loadConfig, AsyncCallback<D> callback);

	@Override
	public final void load(C loadConfig, final Callback<D, Throwable> callback) {
		load(loadConfig, new AsyncCallback<D>() {
			@Override
			public void onFailure(Throwable caught) {
				callback.onFailure(caught);
			}

			@Override
			public void onSuccess(D result) {
				callback.onSuccess(result);
			}
		});
	}
}
